#include "widget_cmd_tool.h"
#include <QStyledItemDelegate>

WidgetCmdTool::WidgetCmdTool(QWidget *parent)
	: QWidget(parent)
{
	ui.setupUi(this);
	itemDelegate = new QStyledItemDelegate(this);
	ui.cb_toolNum->setItemDelegate(itemDelegate);
	ui.cb_value->setItemDelegate(itemDelegate);

}

WidgetCmdTool::~WidgetCmdTool()
{
	itemDelegate->deleteLater();
}

void WidgetCmdTool::updateUI( punch::STechnologyDetail *data/*=NULL*/ )
{
	int tool_num = QString(data->para2).toInt() - 1;
	int value = QString(data->para4).toInt();
	ui.cb_toolNum->setCurrentIndex(tool_num);
	ui.cb_value->setCurrentIndex(value);	
}
